// applyMiddleware注册redux插件的方法
import {createStore,applyMiddleware} from 'redux';
// import {counter} from './reducers';
// reducers的结构 => {counter}
import reducers from './reducers';

// 导入redux-thunk插件;可以实现异步action
import thunk from 'redux-thunk';
// 启用redux调试工具
import { composeWithDevTools } from 'redux-devtools-extension';
// 创建一个store对象,需要有个reducer函数做为参数;
// applyMiddleware(thunk)注册redux-thunk插件, 实现异步action
export const store=createStore(reducers,composeWithDevTools(applyMiddleware(thunk)));
